/*
 * Copyright (C) 2010-2011 Comcast Cable.  All Rights Reserved.
 */
package com.hercules.android.receiver.handlers.events;

import com.hercules.android.receiver.model.events.XREVirtualKeyCode;

/**
 * <p>
 * This interface defines the contract for getting the mapped XREVirtualKeyCode from the raw key code and whether
 * shift/ctrl/alt/meta keys are pressed.
 * </p>
 *
 * <p>
 * <strong>Thread safety: </strong> The implementation of this interface must be thread-safe after initialization
 * </p>
 *
 * @author mekanizumu, jaindsonvs
 * @version 1.0
 */
public interface KeyMappingService {
    /**
     * <p>
     * Get virtual key code from the raw key code and whether shift/ctrl/alt/meta keys are pressed.
     * </p>
     *
     * @param alt
     *            this is true if 'alt' is pressed.
     * @param rawCode
     *            the raw keyboard code.
     * @param ctrl
     *            this is true if 'ctrl' is pressed.
     * @param meta
     *            this is true if 'meta' is pressed.
     * @param shift
     *            this is true if 'shift' is pressed.
     * @return the mapped virtual key code. It could be null.
     * @throws KeyMappingFileLoadingException
     *             if any error occurs
     */
    public XREVirtualKeyCode getVirtualKeyCode(int rawCode, boolean shift, boolean ctrl, boolean alt, boolean meta)
        throws KeyMappingFileLoadingException;
}
